///
/// @ProjectName:    learning_rust
/// @Description:    
/// @File:           jz7.rs
/// @Author:         wujehy
/// @Email:          wujehy@qq.com
/// @Time:           2021-07-01 21:50
///
struct Solution {}

impl Solution {
    fn new() -> Self {
        Solution {}
    }

    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * @param n int整型
     * @return int整型
     */
    #[allow(non_snake_case)]
    pub fn Fibonacci(&self, n: i32) -> i32 {
        // write code here
        if n <= 1 {
            n
        } else {
            self.Fibonacci(n - 1) + self.Fibonacci(n - 2)
        }
    }
}

#[test]
fn test7() {
    let s = Solution::new();
    let expext = 3;
    assert_eq!(expext, s.Fibonacci(4));
}